/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SensorCheckersImpl;

import SensorCheckerInterface.ISensorChecker;
import CommonValue.Temperature;
import DTO.SensorDTO;

/**
 *
 * @author Administrator
 */
public class TemperatureSensorChecker extends BaseSensorChecker implements ISensorChecker{

    public TemperatureSensorChecker() {
        setSensorCheckerSign(Temperature.SIGN);
    }

    @Override
    public boolean CheckSensor(SensorDTO ob) {
        if (this.checkNull(ob)){
            return true;
        }
        if (!this.isMatchSign(ob)){
            return true;
        }
        System.out.println("Check : "+getSensorCheckerSign());
        float temperature = ob.getData().get(Temperature.TEMPERATURE);
        System.out.println(Temperature.TEMPERATURE + " : " + temperature);
        if (temperature<Temperature.TEMPERATURE_MIN || temperature>Temperature.TEMPERATURE_MAX ) return false;
        return true;
    }
    
}
